using UnityEngine;
using Voodoo.Sauce.Internal.Analytics;

namespace Voodoo.Sauce.Internal.GDPR.Utils
{
	public static class VoodooGDPRUtils
	{
		public enum GDPRType
		{
			Voodoo,
			VoodooSP,
			ATT
		}

		private class Info
		{
			public string Name;

			public string PrivacyPolicyUrl;
		}

		private static Info[] _sdks = new Info[6]
		{
			new Info
			{
				Name = "Voodoo",
				PrivacyPolicyUrl = "https://www.voodoo.io/app-privacy-policy"
			},
			new Info
			{
				Name = "Crashlytics",
				PrivacyPolicyUrl = "https://try.crashlytics.com/terms/privacy-policy.pdf"
			},
			new Info
			{
				Name = "Mixpanel",
				PrivacyPolicyUrl = "https://mixpanel.com/legal/privacy-policy/"
			},
			new Info
			{
				Name = "Tenjin",
				PrivacyPolicyUrl = "https://www.tenjin.io/privacy/"
			},
			new Info
			{
				Name = "GameAnalytics",
				PrivacyPolicyUrl = "https://gameanalytics.com/privacy"
			},
			new Info
			{
				Name = "SafeDK",
				PrivacyPolicyUrl = "https://www.safedk.com/privacy"
			}
		};

		private static Info[] _networks = new Info[16]
		{
			new Info
			{
				Name = "AdColony",
				PrivacyPolicyUrl = "https://www.adcolony.com/privacy-policy/"
			},
			new Info
			{
				Name = "AdMob",
				PrivacyPolicyUrl = "https://policies.google.com/privacy"
			},
			new Info
			{
				Name = "AOL",
				PrivacyPolicyUrl = "https://policies.oath.com/us/en/oath/privacy/index.html"
			},
			new Info
			{
				Name = "AppLovin",
				PrivacyPolicyUrl = "https://applovin.com/privacy/"
			},
			new Info
			{
				Name = "AppOnboard",
				PrivacyPolicyUrl = "https://www.apponboard.com/privacy-policy/"
			},
			new Info
			{
				Name = "Chartboost",
				PrivacyPolicyUrl = "https://chartboost.zendesk.com/hc/en-us/articles/200780269-Privacy-Policy?mobile_site=true"
			},
			new Info
			{
				Name = "Facebook",
				PrivacyPolicyUrl = "https://www.facebook.com/about/privacy"
			},
			new Info
			{
				Name = "InMobi",
				PrivacyPolicyUrl = "https://www.inmobi.com/privacy-policy/"
			},
			new Info
			{
				Name = "IQZone",
				PrivacyPolicyUrl = "https://iqzone.com/about/privacy/"
			},
			new Info
			{
				Name = "IronSource",
				PrivacyPolicyUrl = "https://developers.ironsrc.com/ironsource-mobile/air/ironsource-mobile-privacy-policy/"
			},
			new Info
			{
				Name = "Mintegral",
				PrivacyPolicyUrl = "https://www.mintegral.com/en/privacy"
			},
			new Info
			{
				Name = "Mopub",
				PrivacyPolicyUrl = "https://www.mopub.com/legal/privacy/"
			},
			new Info
			{
				Name = "Ogury",
				PrivacyPolicyUrl = "https://www.ogury.com/privacy/"
			},
			new Info
			{
				Name = "Tapjoy",
				PrivacyPolicyUrl = "https://www.tapjoy.com/legal/#privacy-policy"
			},
			new Info
			{
				Name = "UnityAds",
				PrivacyPolicyUrl = "https://unity3d.com/fr/legal/privacy-policy"
			},
			new Info
			{
				Name = "Vungle",
				PrivacyPolicyUrl = "https://vungle.com/privacy/"
			}
		};

		public static GDPRType GetGDPRType()
		{
			return GDPRType.Voodoo;
		}

		public static string GetLocale()
		{
			AndroidJavaClass androidJavaClass = new AndroidJavaClass("java.util.Locale");
			AndroidJavaObject androidJavaObject = androidJavaClass.CallStatic<AndroidJavaObject>("getDefault", new object[0]);
			return androidJavaObject.Call<string>("getCountry", new object[0]);
		}

		public static string GetOsType()
		{
			return "android";
		}

		public static string GetUserStatus()
		{
			return (!VoodooAnalytics.IsFirstTimeAppLaunched()) ? "old" : "new";
		}

		public static string GetVSVersion()
		{
			return "3.4.0b4";
		}

		public static string GetAppVersion()
		{
			return Application.version;
		}

		public static string GetPopupVersion()
		{
			return "1.0";
		}

		public static string[] GetSdksNames()
		{
			string[] array = new string[_sdks.Length];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = _sdks[i].Name;
			}
			return array;
		}

		public static string[] GetAllPrivacyPolicies()
		{
			string[] array = new string[_sdks.Length + _networks.Length];
			for (int i = 0; i < _sdks.Length; i++)
			{
				array[i] = _sdks[i].PrivacyPolicyUrl;
			}
			for (int j = 0; j < _networks.Length; j++)
			{
				array[j + _sdks.Length] = _networks[j].PrivacyPolicyUrl;
			}
			return array;
		}

		public static string[] GetNetworksNames()
		{
			string[] array = new string[_networks.Length];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = _networks[i].Name;
			}
			return array;
		}
	}
}
